package com.study.service;

import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @author : wilbur.yuan
 * @date : 2018-11-21
 */
@Service
@Profile("prd")
public class TimeWindowServicePrdProfile implements TimeWindowService {

    private static final LocalDateTime start = LocalDateTime.of(2018, 11, 30,21,59,59);

    private static final LocalDateTime end = LocalDateTime.of(2018, 12, 5,0,0,0);

    @Override
    public boolean filter() {

        LocalDateTime now = LocalDateTime.now();

        return now.isAfter(start) && now.isBefore(end);

    }
}
